const {WebPort} = require('@build/config.js')
let webpackDevConfig = require('@build/webpack.config.render.js')
let windowUrl = {
    'D':{},
    'P':{}
}
const isDev = process.env.NODE_ENV !== 'production'
windowUrl.D = {
    'provider':`http://localhost:${WebPort}/provider.html`,
    'debugger':`http://localhost:${WebPort}/debugger.html`,
    'browserWindow':`http://localhost:${WebPort}/browser.html`
}
const outPath = webpackDevConfig.outPath.path
webpackDevConfig = null
windowUrl.P = {
    'provider':`file://${outPath}/provider.html`,
    'debugger':`file://${outPath}/debugger.html`,
    'browserWindow':`file://${outPath}/browser.html`
}
function getWindowUrl(isDev=isDev) {
    return isDev?windowUrl.D:windowUrl.P
}
exports.windowUrl = getWindowUrl(isDev)
exports.getWindowUrl = getWindowUrl